//2009/08/28 00:43:07
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <sstream>
#include <algorithm>

using namespace std;

class DreamingAboutCarrots
{
public:
    int carrotsBetweenCarrots(int x1, int y1, int x2, int y2)
    {
        int ret = 0;
        int x = min(x1, x2);
        int xx = max(x1, x2);
        int y = min(y1, y2);
        int yy = max(y1, y2);
        for (int i=x; i<=xx; i++)
            for (int j=y; j<=yy; j++)
            {
                if ((y1-y2)*(x1-i) == (y1-j)*(x1-x2))
                    ret ++;
            }
        return ret-2;
    }
};
